<template>
    <el-table :data="tableData" style="width: 100%" :row-class-name="tableRowClassName">
        <el-table-column prop="date" width="180" />
        <el-table-column prop="name" width="180" />
        <el-table-column prop="address" />
    </el-table>
</template>

<script lang="ts" setup>


const tableRowClassName = ({

    rowIndex,
}: {
    // row: User
    rowIndex: number
}) => {
    if (rowIndex === 1) {
        return 'warning-row'
    } else if (rowIndex === 3) {
        return 'success-row'
    }
    return ''
}

const tableData = [
    {
        date: '系统信息',

        address: '',
    },
    {
        date: '服务器操作系统',

        address: ' WINNT',
    },
    {
        date: 'WEB运行环境',

        address: 'cgi-fcgi',
    },
    {
        date: '运行PHP版本',

        address: 'N7.3.4',
    },
]
</script>

<style>
.el-table .warning-row {
    --el-table-tr-bg-color: var(--el-color-warning-light-9);
}

.el-table .success-row {
    --el-table-tr-bg-color: var(--el-color-success-light-9);
}
</style>